package com.LLL.product.controller;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.runtime.ObjectMethods;
import java.util.List;
import java.util.Map;

public class OrderServlet  extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        String data = req.getParameter("data");
        ObjectMapper mapper = new ObjectMapper();
        //将请求体中JSON字符串转换成map对象
        List<Map<String, Object>> requestBody = mapper.readValue(req.getReader(), List.class);
        System.out.println(data);
    }
}
